class Solution {
    public int lengthOfLongestSubstring(String s) {
        if(s.length() == 0){
            return 0;
        }
        int[] hash = new int[128];
        int ret = Integer.MIN_VALUE;
        for(int left = 0, right = 0; right < s.length(); right++){
            //入窗口
            char inchar = s.charAt(right);
            hash[inchar]++;
            while(hash[inchar] > 1){
                char outchar = s.charAt(left);
                hash[outchar]--;
                left++;
            }
            ret = Math.max(right - left + 1, ret);
        }
        return ret;
    }
}i
